Conversation
Collaborator
Contributor
Author
|
OHH thats so much better haha |
…de-4-Community/fcc into 75-Donation-Donor-Stats-Chart # Conflicts: # apps/frontend/src/app.tsx # yarn.lock
thaninbew
requested changes
Feb 19, 2026
Collaborator
thaninbew
left a comment
There was a problem hiding this comment.
In the file DonorStatsChart.tsx, there's a problem with the first useEffect. It has activeChart in its dependency array, which means every time you click a tab to switch charts, it makes a new API call to fetch donation data. This is wasteful because the data is already stored in the component's state.
The second useEffect already handles switching between the two chart views when activeChart changes, so we don't need the first one to re-run.
Collaborator
|
gonna merge first then u can open a new PR for this bc people need this code now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Added chart.tsx and dropdown-menu.tsx shadcn components.
Added getDonations to frontend apiClient to fetch all donations for the chart.
Added DonorStatsChart.tsx as a component to show the chart with the donation data.
Updated app.tsx to add the chart display under /chart as an admin-protected page.
Changes Made
Testing & Verification
Verification Steps:
Run yarn to install new packages needed for new shadcn components.
Run this SQL in adminer to add in sample data into the donations table:
Then go to /admin and login with an admin account and view the graph.
Screenshots (if relevant)
Frontend.And.97.More.Pages.-.Personal.-.Microsoft.Edge.2026-02-18.19-37-07.mp4
Future Improvements/Notes
Related Issues
Closes #75